<%= render partial: 'shipit/stacks/header', locals: { stack: @stack } %>

<div class="wrapper">
  <section>
    <header class="section-header">
      <p><%= @task.definition.description %></p>
    </header>
  </section>

  <section>
    <pre class="nowrap code-preview"><code><%= @task.definition.steps.join("\n") %></code></pre>
  </section>

  <%= render_checklist @task.checklist %>

  <%= form_for @task, url: stack_tasks_path(@stack, definition_id: @task.definition.id) do |f| %>

    <%= render partial: 'shipit/variables', locals: { variables: @task.definition.variables, form: f, header: "Environment Variables", field_name: :env}  %>

    <section class="submit-section">
      <% if !@task.definition.allow_concurrency? && @stack.active_task? %>
        <%= render 'shipit/deploys/concurrent_deploy_warning' %>
      <% end %>

      <%= f.submit @task.definition.action, :class => ['btn', 'primary', 'trigger-deploy'] %>
    </section>

  <% end %>
</div>
